package com.yanqu.road.server.cmd.activity.metaspace;

import com.yanqu.road.pb.activity.MetaSpaceProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.activity.metaspace.CrossMetaSpaceMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.CrossProtocol;

@Cmd(code = CrossProtocol.C_CROSS_META_SPACE_TRIGGER, desc = "")
public class MetaSpaceTriggerCmd extends CrossCommand {
    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        MetaSpaceProto.SendTriggerToCrossReqMsg req = MetaSpaceProto.SendTriggerToCrossReqMsg.parseFrom(packet.getBytes());
        int activityId = req.getActivityId();
        int conditionId = req.getConditionId();
        long userId = packet.getPlayerId();
        CrossMetaSpaceMgr.trigger(activityId, conditionId, serverId, userId);
    }

    @Override
    public void sendData() {

    }
}
